home *** CD-ROM | disk | FTP | other *** search
- Subject: Feedback on Overriding FW_CBitmapShape
- Sent: 7/17/96 2:43 AM
- Received: 7/17/96 9:00 AM
- From: Hutchings, Richard B. "Brad", brad@hutchings-software.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- Just some general feedback...
-
- The project for this evening was overriding FW_CBitmapShape to do masked
- copy.
- The idea is that I want non-white pixels in the bitmap transferred to the
- canvas without changing their color, but want the canvas bits to remain
- unchanged where there are white bitmap pixels. None of the standard
- transfer modes achieve this. Awhile back, probably before R1, the comment
- was made that we (ODF users) had access to all of the internal structures,
- so I could theoretically just get the pixelmap and deal with it. Not quite.
-
- Basically, the Mac implementation for this could have boiled down to adding
- 1 line of code in FW_PrivRenderBitmap, BUT I figured those files start with
- "PR" because it wasn't a good idea for me to mess with them.
-
- So, I subclassed FW_CBitmapShape, copying most of FW_PrivRenderBitmap to
- the Render method and substituting the CopyBits line:
-
- /*
- ::CopyBits((BitMap*)*pmh, &FW_QDGlobals.thePort->portBits,
- &plfmSrcRect, &plfmDstRect,
- ink->GetTransferMode(), NULL);
- */
- ::CopyMask((BitMap*)*pmh, (BitMap*)*pmh,
- &FW_QDGlobals.thePort->portBits,
- &plfmSrcRect, &plfmSrcRect, &plfmDstRect);
-
- It actually yields the desired results even though pmh is a pixmap. I still
- can't quite figure out how to filter the source image through a gray (or
- any other) pattern though.
-
- One problem I ran into is that the functions in the "PR" files aren't
- exported in the OS Library, so I had to add 3 "PR" files to my project.
-
- My conclusion from my current part editor project is that the ODF drawing
- model is great for basic shapes, fairly good for text, and not too good for
- bitmaps.
-
- Brad
-
- <mailto: "Brad Hutchings" brad@hutchings-software.com>
- <http://www.hutchings-software.com>
-
- Ask me about:
- Hutchings Software's Rapid-I(tm) Button
- Hutchings Software's Essential Strips(tm)
-
-
-